<template>
  <div class="contact-page">
    <!-- Main Content -->
    <div class="main-content">
      <!-- Hero Section -->
      <section class="hero-section">
        <div class="hero-bg"></div>
        <div class="hero-content">
          <h1 class="hero-title">与我们联系·开启设计合作</h1>
          <p class="hero-subtitle">无论企业需求还是学生咨询，我们随时倾听您的设计想法</p>
        </div>
      </section>

      <!-- Contact Section -->
      <section class="contact-section">
        <div class="contact-container">
          <!-- Left Side - Form -->
          <div class="form-side">
            <div class="form-header">
              <h2 class="form-title">提交咨询</h2>
              <div class="form-divider"></div>
            </div>
            
            <form class="contact-form" @submit.prevent="submitForm">
              <div class="form-row">
                <div class="input-group">
                  <input 
                    type="text" 
                    class="form-input" 
                    placeholder="您的姓名" 
                    v-model="form.name"
                  >
                </div>
              </div>
              
              <div class="form-row">
                <div class="input-group">
                  <input 
                    type="text" 
                    class="form-input" 
                    placeholder="联系电话或邮箱" 
                    v-model="form.contact"
                  >
                </div>
              </div>
              
              <div class="form-row">
                <div class="input-group select-group">
                  <select class="form-select" v-model="form.serviceType">
                    <option value="" disabled>选择服务类型</option>
                    <option value="brand">品牌设计</option>
                    <option value="web">网站设计</option>
                    <option value="app">APP设计</option>
                    <option value="graduation">毕业设计</option>
                    <option value="other">其他</option>
                  </select>
                  <div class="select-arrow">
                    <svg viewBox="0 0 24 24" fill="currentColor">
                      <path d="M7 10l5 5 5-5z"/>
                    </svg>
                  </div>
                </div>
              </div>
              
              <div class="form-row">
                <div class="input-group">
                  <textarea 
                    class="form-textarea" 
                    placeholder="请简要描述您的需求" 
                    v-model="form.description"
                    rows="4"
                  ></textarea>
                </div>
              </div>
              
              <div class="form-row checkbox-row">
                <label class="checkbox-label">
                  <input type="checkbox" v-model="form.newsletter" class="checkbox-input">
                  <span class="checkbox-custom">
                    <svg class="check-icon" viewBox="0 0 24 24" fill="none">
                      <path d="M20 6L9 17l-5-5" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
                    </svg>
                  </span>
                  <span class="checkbox-text">我希望收到设计案例推送</span>
                </label>
              </div>
              
              <div class="form-row">
                <button type="submit" class="submit-button">
                  <span>发送咨询</span>
                </button>
              </div>
            </form>
          </div>

          <!-- Right Side - Company Info -->
          <div class="info-side">
            <div class="company-section">
              <h3 class="company-name">北京悦而科技有限公司</h3>
              
              <div class="contact-info">
                <div class="contact-item">
                  <div class="contact-icon phone-icon">
                    <svg viewBox="0 0 24 24" fill="currentColor">
                      <path d="M6.62 10.79c1.44 2.83 3.76 5.14 6.59 6.59l2.2-2.2c.27-.27.67-.36 1.02-.24 1.12.37 2.33.57 3.57.57.55 0 1 .45 1 1V20c0 .55-.45 1-1 1-9.39 0-17-7.61-17-17 0-.55.45-1 1-1h3.5c.55 0 1 .45 1 1 0 1.25.2 2.45.57 3.57.11.35.03.74-.25 1.02l-2.2 2.2z"/>
                    </svg>
                  </div>
                  <span class="contact-text">+86-138-8888-8888</span>
                </div>
                
                <div class="contact-item">
                  <div class="contact-icon email-icon">
                    <svg viewBox="0 0 24 24" fill="currentColor">
                      <path d="M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4l-8 5-8-5V6l8 5 8-5v2z"/>
                    </svg>
                  </div>
                  <span class="contact-text">contact@yueerqisi.com</span>
                </div>
                
                <div class="contact-item">
                  <div class="contact-icon location-icon">
                    <svg viewBox="0 0 24 24" fill="currentColor">
                      <path d="M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5c-1.38 0-2.5-1.12-2.5-2.5s1.12-2.5 2.5-2.5 2.5 1.12 2.5 2.5-1.12 2.5-2.5 2.5z"/>
                    </svg>
                  </div>
                  <span class="contact-text">贵阳市观山湖区绿地联盛国际11号楼1103</span>
                </div>
              </div>
              
              <div class="social-section">
                <h4 class="social-title">关注我们</h4>
                <div class="social-links">
                  <div class="social-item">
                    <div class="social-icon wechat-icon">
                      <svg viewBox="0 0 24 24" fill="currentColor">
                        <path d="M9.5 11.5c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5zm5 0c-.83 0-1.5-.67-1.5-1.5s.67-1.5 1.5-1.5 1.5.67 1.5 1.5-.67 1.5-1.5 1.5z"/>
                        <path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2z"/>
                      </svg>
                    </div>
                    <span class="social-text">微信</span>
                  </div>
                  
                  <div class="social-item">
                    <div class="social-icon weibo-icon">
                      <svg viewBox="0 0 24 24" fill="currentColor">
                        <path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2z"/>
                      </svg>
                    </div>
                    <span class="social-text">微博</span>
                  </div>
                  
                  <div class="social-item">
                    <div class="social-icon qq-icon">
                      <svg viewBox="0 0 24 24" fill="currentColor">
                        <path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2z"/>
                      </svg>
                    </div>
                    <span class="social-text">QQ</span>
                  </div>
                </div>
              </div>
            </div>
            
            <!-- WeChat QR Code Card -->
            <div class="wechat-card">
              <div class="wechat-header">
                <div class="wechat-icon-large">
                  <svg viewBox="0 0 24 24" fill="currentColor">
                    <path d="M8.5 12c-.83 0-1.5-.67-1.5-1.5S7.67 9 8.5 9s1.5.67 1.5 1.5-.67 1.5-1.5 1.5zm7 0c-.83 0-1.5-.67-1.5-1.5S14.67 9 15.5 9s1.5.67 1.5 1.5-.67 1.5-1.5 1.5z"/>
                  </svg>
                </div>
                <div class="wechat-info">
                  <div class="wechat-label">联系微信号</div>
                  <div class="wechat-id">YUERKEJI8888</div>
                </div>
                <div class="wechat-copy">
                  <svg viewBox="0 0 24 24" fill="currentColor">
                    <path d="M16 1H4c-1.1 0-2 .9-2 2v14h2V3h12V1zm3 4H8c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h11c1.1 0 2-.9 2-2V7c0-1.1-.9-2-2-2zm0 16H8V7h11v14z"/>
                  </svg>
                </div>
              </div>
              <div class="qr-code">
                <div class="qr-placeholder">
                  <div class="qr-center">
                    <svg viewBox="0 0 24 24" fill="currentColor">
                      <path d="M8.5 12c-.83 0-1.5-.67-1.5-1.5S7.67 9 8.5 9s1.5.67 1.5 1.5-.67 1.5-1.5 1.5zm7 0c-.83 0-1.5-.67-1.5-1.5S14.67 9 15.5 9s1.5.67 1.5 1.5-.67 1.5-1.5 1.5z"/>
                    </svg>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </section>

      <!-- FAQ Section -->
      <section class="faq-section">
        <div class="faq-container">
          <div class="faq-header">
            <h2 class="faq-title">咨询前了解</h2>
            <p class="faq-subtitle">Find out before you consult</p>
          </div>
          
          <div class="faq-list">
            <div class="faq-item" v-for="(faq, index) in faqs" :key="index">
              <div class="faq-question" @click="toggleFaq(index)">
                <span class="faq-text">{{ faq.question }}</span>
                <div class="faq-arrow" :class="{ 'expanded': faq.expanded }">
                  <svg viewBox="0 0 24 24" fill="currentColor">
                    <path d="M7 10l5 5 5-5z"/>
                  </svg>
                </div>
              </div>
              <div class="faq-answer" v-show="faq.expanded">
                <p>{{ faq.answer }}</p>
              </div>
            </div>
          </div>
        </div>
      </section>


    </div>
  </div>
</template>

<script lang="ts">
import { defineComponent, ref } from 'vue';

export default defineComponent({
  name: 'ContactPage',
  setup() {
    const form = ref({
      name: '',
      contact: '',
      serviceType: '',
      description: '',
      newsletter: false
    });
    
    const faqs = ref([
      {
        question: '设计咨询是否需要付费?',
        answer: '初步咨询是免费的，我们会根据您的需求提供专业建议。详细的设计方案制定会根据项目复杂度收取相应费用。',
        expanded: false
      },
      {
        question: '毕设设计的交付周期是多久?',
        answer: '毕业设计的交付周期通常为2-4周，具体时间根据设计复杂度和要求而定。我们会在项目开始前与您确认详细的时间安排。',
        expanded: false
      }
    ]);
    
    const submitForm = () => {
      console.log('Form submitted:', form.value);
      // Add form submission logic here
    };
    
    const toggleFaq = (index: number) => {
      faqs.value[index].expanded = !faqs.value[index].expanded;
    };
    
    return {
      form,
      faqs,
      submitForm,
      toggleFaq
    };
  }
});
</script>

<style lang="scss" scoped>
.contact-page {
  min-height: 100vh;
  background: #1a1a2e;
  color: white;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

// Main Content
.main-content {
  position: relative;
}

// Hero Section
.hero-section {
  position: relative;
  padding: 120px 0 80px;
  text-align: center;
  background: linear-gradient(rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.6)), url('https://images.unsplash.com/photo-1423666639041-f56000c27a9a?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=2074&q=80') center/cover no-repeat;
  background-attachment: fixed;
  
  .hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(0, 122, 255, 0.1) 0%, rgba(0, 86, 204, 0.1) 100%);
    z-index: 0;
  }
  
  .hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
    padding: 0 40px;
  }
  
  .hero-title {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 20px;
    line-height: 1.2;
  }
  
  .hero-subtitle {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.8);
    line-height: 1.6;
  }
}

// Contact Section
.contact-section {
  padding: 80px 0;
  
  .contact-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 40px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: start;
  }
}

// Form Side
.form-side {
  .form-header {
    margin-bottom: 40px;
    
    .form-title {
      font-size: 28px;
      font-weight: 600;
      margin-bottom: 20px;
    }
    
    .form-divider {
      width: 60px;
      height: 3px;
      background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
      border-radius: 2px;
    }
  }
  
  .contact-form {
    .form-row {
      margin-bottom: 24px;
      
      &.checkbox-row {
        margin-bottom: 32px;
      }
    }
    
    .input-group {
      position: relative;
      
      &.select-group {
        .select-arrow {
          position: absolute;
          right: 16px;
          top: 50%;
          transform: translateY(-50%);
          width: 20px;
          height: 20px;
          color: rgba(255, 255, 255, 0.6);
          pointer-events: none;
        }
      }
    }
    
    .form-input,
    .form-select,
    .form-textarea {
      width: 100%;
      padding: 16px 20px;
      background: rgba(255, 255, 255, 0.05);
      border: 2px solid rgba(255, 255, 255, 0.1);
      border-radius: 12px;
      color: white;
      font-size: 16px;
      transition: all 0.3s ease;
      
      &::placeholder {
        color: rgba(255, 255, 255, 0.6);
      }
      
      &:focus {
        outline: none;
        border-color: rgba(102, 126, 234, 0.5);
        background: rgba(255, 255, 255, 0.08);
        box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
      }
    }
    
    .form-select {
      appearance: none;
      cursor: pointer;
      
      option {
        background: #1a1a2e;
        color: white;
      }
    }
    
    .form-textarea {
      resize: vertical;
      min-height: 120px;
      font-family: inherit;
    }
    
    .checkbox-label {
      display: flex;
      align-items: center;
      cursor: pointer;
      
      .checkbox-input {
        display: none;
      }
      
      .checkbox-custom {
        width: 20px;
        height: 20px;
        border: 2px solid rgba(255, 255, 255, 0.3);
        border-radius: 4px;
        margin-right: 12px;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.3s ease;
        
        .check-icon {
          width: 12px;
          height: 12px;
          opacity: 0;
          transition: opacity 0.3s ease;
        }
      }
      
      .checkbox-text {
        color: rgba(255, 255, 255, 0.8);
        font-size: 14px;
      }
      
      .checkbox-input:checked + .checkbox-custom {
        background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        border-color: transparent;
        
        .check-icon {
          opacity: 1;
        }
      }
    }
    
    .submit-button {
      width: 100%;
      padding: 16px 32px;
      background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
      border: none;
      border-radius: 12px;
      color: white;
      font-size: 16px;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.3s ease;
      
      &:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
      }
      
      &:active {
        transform: translateY(0);
      }
    }
  }
}

// Info Side
.info-side {
  .company-section {
    margin-bottom: 40px;
    
    .company-name {
      font-size: 24px;
      font-weight: 600;
      margin-bottom: 32px;
    }
    
    .contact-info {
      margin-bottom: 40px;
      
      .contact-item {
        display: flex;
        align-items: center;
        margin-bottom: 20px;
        
        .contact-icon {
          width: 20px;
          height: 20px;
          margin-right: 16px;
          color: rgba(255, 255, 255, 0.8);
        }
        
        .contact-text {
          color: rgba(255, 255, 255, 0.9);
          font-size: 16px;
        }
      }
    }
    
    .social-section {
      .social-title {
        font-size: 18px;
        font-weight: 600;
        margin-bottom: 20px;
      }
      
      .social-links {
        display: flex;
        gap: 24px;
        
        .social-item {
          display: flex;
          align-items: center;
          
          .social-icon {
            width: 16px;
            height: 16px;
            margin-right: 8px;
            color: rgba(255, 255, 255, 0.7);
          }
          
          .social-text {
            color: rgba(255, 255, 255, 0.8);
            font-size: 14px;
          }
        }
      }
    }
  }
  
  .wechat-card {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    
    .wechat-header {
      display: flex;
      align-items: center;
      margin-bottom: 20px;
      
      .wechat-icon-large {
        width: 24px;
        height: 24px;
        margin-right: 12px;
        color: #1aad19;
      }
      
      .wechat-info {
        flex: 1;
        
        .wechat-label {
          font-size: 12px;
          color: rgba(255, 255, 255, 0.6);
          margin-bottom: 4px;
        }
        
        .wechat-id {
          font-size: 16px;
          font-weight: 600;
          color: white;
        }
      }
      
      .wechat-copy {
        width: 20px;
        height: 20px;
        color: rgba(255, 255, 255, 0.6);
        cursor: pointer;
        transition: color 0.3s ease;
        
        &:hover {
          color: rgba(255, 255, 255, 0.8);
        }
      }
    }
    
    .qr-code {
      .qr-placeholder {
        width: 120px;
        height: 120px;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 8px;
        position: relative;
        display: flex;
        align-items: center;
        justify-content: center;
        
        &::before {
          content: '';
          position: absolute;
          top: 0;
          left: 0;
          right: 0;
          bottom: 0;
          background-image: linear-gradient(
            45deg,
            rgba(255, 255, 255, 0.3) 25%,
            rgba(255, 255, 255, 0.5) 25%, 
            rgba(255, 255, 255, 0.5) 50%, 
            rgba(255, 255, 255, 0.3) 50%, 
            rgba(255, 255, 255, 0.3) 75%, 
            rgba(255, 255, 255, 0.5) 75%
          );
          background-size: 10px 10px;
          z-index: 0;
        }
        
        .qr-center {
          position: relative;
          z-index: 1;
          width: 24px;
          height: 24px;
          background: rgba(26, 26, 46, 0.8);
          border-radius: 4px;
          display: flex;
          align-items: center;
          justify-content: center;
          color: #1aad19;
        }
      }
    }
  }
}

// FAQ Section
.faq-section {
  padding: 80px 0;
  background: rgba(255, 255, 255, 0.02);
  
  .faq-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 40px;
  }
  
  .faq-header {
    text-align: center;
    margin-bottom: 60px;
    
    .faq-title {
      font-size: 36px;
      font-weight: 600;
      margin-bottom: 12px;
    }
    
    .faq-subtitle {
      font-size: 16px;
      color: rgba(255, 255, 255, 0.6);
    }
  }
  
  .faq-list {
    .faq-item {
      background: rgba(255, 255, 255, 0.05);
      border-radius: 12px;
      margin-bottom: 16px;
      overflow: hidden;
      border: 1px solid rgba(255, 255, 255, 0.1);
      
      .faq-question {
        padding: 24px;
        cursor: pointer;
        display: flex;
        justify-content: space-between;
        align-items: center;
        transition: background 0.3s ease;
        
        &:hover {
          background: rgba(255, 255, 255, 0.03);
        }
        
        .faq-text {
          font-size: 16px;
          font-weight: 500;
          color: white;
        }
        
        .faq-arrow {
          width: 20px;
          height: 20px;
          color: rgba(255, 255, 255, 0.6);
          transition: transform 0.3s ease;
          
          &.expanded {
            transform: rotate(180deg);
          }
        }
      }
      
      .faq-answer {
        padding: 0 24px 24px;
        
        p {
          color: rgba(255, 255, 255, 0.8);
          line-height: 1.6;
          margin: 0;
        }
      }
    }
  }
}

// Background Image
.bg-image {
  position: fixed;
  top: 0;
  right: 0;
  width: 300px;
  height: 400px;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.1), rgba(118, 75, 162, 0.1));
  z-index: 0;
  pointer-events: none;
}

// Responsive Design
@media (max-width: 768px) {
  .hero-section {
    padding: 60px 0 40px;
    
    .hero-content {
      padding: 0 20px;
    }
    
    .hero-title {
      font-size: 32px;
    }
    
    .hero-subtitle {
      font-size: 16px;
    }
  }
  
  .contact-section {
    padding: 60px 0;
    
    .contact-container {
      padding: 0 20px;
      grid-template-columns: 1fr;
      gap: 60px;
    }
  }
  
  .faq-section {
    padding: 60px 0;
    
    .faq-container {
      padding: 0 20px;
    }
    
    .faq-header {
      margin-bottom: 40px;
      
      .faq-title {
        font-size: 28px;
      }
    }
  }
}
</style>